//
//  BannerCell.m
//  gungunchou
//
//  Created by lyzbmacos3 on 2018/12/4.
//  Copyright © 2018年 xskj. All rights reserved.
//

#import "BannerCell.h"

@implementation BannerCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self configBannerView];
    
}

- (void)setModel:(HomeIndexModel *)model
{
    if (model) {
        _model = model;
        NSMutableArray *mArr = NSMutableArray.new;
        for (BannerModel *bannerModel in model.BannerList) {
            if ([LJUtility theStringIsValid:bannerModel.Image]) {
                [mArr addObject:bannerModel.Image];
            }
        }
        self.bannerView.imageURLStringsGroup = mArr.copy;
    }
}

- (void)configBannerView
{
    // 自动滚动时间间隔
    self.bannerView.autoScrollTimeInterval = 4.0f;
    self.bannerView.delegate = self;
    // 图片数组
//    NSArray *testImgArr = @[@"http://lyzbimage.jbxgo.com/lyzbjbxgo/backend/444/images/2018/11/27/15433087312932.jpg",@"http://lyzbimage.jbxgo.com/lyzbjbxgo/backend/gallery/2018/12/03/15438089231656.jpg",@"http://m.jbxgo.com/lbsnew/static/img/bktj.da26f90.jpg"];
//    self.bannerView.localizationImageNamesGroup = testImgArr;
    
//    self.bannerView.placeholderImage = [UIImage imageNamed:@"testgoodsimg"];
    
//    // 翻页 右下角
//    self.bannerView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
//    // 图片对应的标题的 背景色。（因为没有设标题）
//    self.bannerView.titleLabelBackgroundColor = [UIColor clearColor];
//    // 当前原点颜色
//    self.bannerView.currentPageDotColor = [UIColor colorWithRed:222/255.0 green:24/255.0 blue:23/255.0 alpha:1];
//    // 清除缓存
//    [SDCycleScrollView clearImagesCache];
}

/** 点击图片回调 */
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index
{
    
}

/** 图片滚动回调 */
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index
{
    
}
@end
